package org.example.jdk8.stream;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

public class test4 {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("hello", "world", "hello world");

//        list.stream().filter(s -> s.length() == 5).findFirst().ifPresent(System.out::println);

        list.stream().mapToInt(s -> {
            int lenght = s.length();
            System.out.println(s);
            return lenght;
        }).filter(l -> l == 5).findFirst().ifPresent(System.out::println);

    }
}
